package cc.wenshixin.features;

import javax.swing.*;

public class TooltipsTest {
    static final int WIDTH = 300;
    static final int HEIGHT = 200;

    public static void main(String[] args) {
        JFrame jf = new JFrame("鼠标停留提示");
        jf.setSize(WIDTH, HEIGHT);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JPanel contentPane = new JPanel();
        jf.setContentPane(contentPane);

        JButton btnConfirm = new JButton("确定");
        JButton btnCancel = new JButton("取消");
        contentPane.add(btnConfirm);
        contentPane.add(btnCancel);
        btnConfirm.setToolTipText("这个按钮是一个确定按钮");
        btnCancel.setToolTipText("这个按钮是一个取消按钮");

        jf.setVisible(true);
    }
}
